﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace information
{
    public partial class login : Form
    {
        public string StrUser="admin";
        public string StrPassword="admin";
        public login()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }



        private void button_cancel_Click(object sender, EventArgs e)
        {
            this.Close();//C#语言用引用变量this记录调用方法Close()的对象,表示类的当前实例
        }


        private void button_confirmation_Click(object sender, EventArgs e)
        {
            if (textBox_user.Text != StrUser)
            {
                MessageBox.Show("账号错误！");//Show()静态方法
                textBox_user.Focus();
                textBox_user.Text = ""; 

            }
            else
                if (textBox_password.Text != StrPassword)
                {
                    MessageBox.Show("密码错误！");
                    textBox_password.Focus();
                    textBox_password.Text = "";

                }
                else
                {
                    
                    main frmMain = new main();//创建main类实例
                    frmMain.Show();
                    this.Hide();//this关键字代表当前实例
                    
                }

        }




        

    }
}
